﻿using ExcelParser.CodeGen;
using NPOI.SS.UserModel;
using System.Collections.Generic;

namespace ExcelParser.Reader
{
    public class ExcelSheet
    {
        public string path;
        public IWorkbook workbook;
        public ISheet sheet;
        public IRow fieldNameRow;
        public IRow fieldTypeRow;
        public IRow fieldDescRow;
        public Config config;
        public string name;
        public List<string> primaryKeys;
        public string nspace;
        public int startDataRowIndex;
        public string code;

        public string FullName
        {
            get
            {
                return string.IsNullOrEmpty(nspace) ? name : nspace + "." + name;
            }
        }

        public void GenCode()
        {
            code = config.GenCode(this);
        }
    }
}